//crypto.h文件
#ifndef __CRYPTO_H__
#define __CRYPTO_H__

#include <stdint.h>

#define CRYPTO_RC4_KEY_SIZE                    16
#define CRYPTO_AES_KEY_128BITS                 128
#define CRYPTO_AES_KEY_256BITS                 256
#define CRYPTO_AES_PADDING_NOPADDING           0
#define CRYPTO_AES_PADDING_ZEROPADDING         1
#define CRYPTO_AES_PADDING_PKCS5PADDING        2

#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

int crypto_aes_cbc_encrypt(const uint8_t *input, int len,
        uint8_t *output, const uint8_t *key, const uint8_t *iv,
        int keybits, int pad_type);

int crypto_aes_cbc_decrypt(const uint8_t *input, int len,
        uint8_t *output, const uint8_t *key, const uint8_t *iv,
        int keybits, int pad_type);

int crypto_aes_ecb_encrypt(const uint8_t *input, int len,
        uint8_t *output, const uint8_t *key, int keybits);

int crypto_aes_ecb_decrypt(const uint8_t *data, int len,
        uint8_t *output, const uint8_t *key, int keybits);

int crypto_rc4(const uint8_t *data, int len, uint8_t *output,
        const uint8_t *key, int key_size);

int crypto_md5(uint8_t *data, int len, uint8_t dest[16]);

int crypto_sha1(uint8_t *data, int len, uint8_t dest[20]);

int crypto_sha224(uint8_t *data, int len, uint8_t dest[28]);

int crypto_sha256(uint8_t *data, int len, uint8_t dest[32]);

int crypto_sha384(uint8_t *data, int len, uint8_t dest[48]);

int crypto_sha512(uint8_t *data, int len, uint8_t dest[64]);

#ifdef __cplusplus
}
#endif  /* __cplusplus */

#endif  /* __CRYPTO_H__ */
